home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
HYP
/
C-D
/
DeveloperStax.cpt
/
Developer Stack 1.0
/
card_5204.txt
< prev
next >
Wrap
Text File
|
1989-02-26
|
3KB
|
128 lines
-- card: 5204 from stack: in.0
-- bmap block id: 0
-- flags: 4000
-- background id: 2612
-- name: DeProtect
-- part 1 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=224 top=243 right=293 bottom=283
-- title width / last selected line: 0
-- icon id / first selected line: 27056 / 27056
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Try It
----- HyperTalk script -----
on mouseUp
if the optionkey is down then
pass mouseup
end if
put "Please select a protected stack"
set cursor to 4
put filename("STAK") into fname
if fname is empty then
hide message window
exit mouseUp
end if
deprotect fname
if the result is empty
then answer "Deprotect Successful" with "OK"
else if the result is -49
then answer "Sorry, that file is busy."
else if the result is -44
then answer "Sorry, the disk is locked."
else answer "Failed: unexpected file system error: " & the result with "OK"
end mouseUp
-- part 2 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=82 top=302 right=324 bottom=182
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Install
----- HyperTalk script -----
on mouseUp
if the optionkey is down then
pass mouseup
end if
put (long name of this stack) into sourceStack
delete first word of sourceStack
delete first character of sourceStack
delete last character of sourceStack
put "Select a stack to copy this resource into."
put filename("STAK") into fname
if fname is empty then
hide message window
exit mouseup
end if
if sourcestack=fname then
beep
Answer "Get real. You can't install it in this stack"
hide message window
exit mouseup
end if
--
ModResCopy sourceStack,fname,"XCMD","DeProtect"
--
get the result
if first char of it is "E" then
put it into the message box
beep
answer "Attempt to install resource has failed."
else
beep
answer "Resource installation successful"
end if
hide message window
end mouseUp
-- part contents for background part 2
----- text -----
DeProtect
-- part contents for background part 3
----- text -----
Calling this will let you remove the standard Hypercard protection from any stack.
Thanks to:
Ned Horvath
Allan Foster
-- part contents for background part 10
----- text -----
Syntax:
DeProtect <filename>
<filename> is the name of a Hypercard Stack.
If no value is returned to result, then deprotection was successful.
A -44 is a disk locked error.
A -49 is a file busy error.
Other numbers are misc errors.
-- part contents for background part 13
----- text -----
2